<div id="slides" class="slider">
    <div class="slides_container">
        <?php foreach ($banners as $banner): ?>
        <?php if (isset($banner->picture)): ?>
        <a href="<?php echo $banner->url; ?>" target="_blank"><?php echo CHtml::image(Yii::app()->baseUrl."/uploads/banner/".$banner->picture->name.".".$banner->picture->ext, $banner->name, array('width'=>960))?></a>
        <?php endif; ?>
        <?php endforeach; ?>
    </div>
</div>

<?php 
$cs = Yii::app()->clientScript;
$cs->registerCoreScript('jquery');
$cs->registerScriptFile(Yii::app()->baseUrl . '/js/slides.min.jquery.js', CClientScript::POS_HEAD);
$cs->registerScript('slider', "
    $('#slides').slides({
        preload: true,
        preloadImage: '".Yii::app()->baseUrl."/images/loading.gif',
        paginationClass: 'slider-tabs',
        currentClass: 'active',
        effect: 'fade',
        crossfade: true,
        play: 4000,
        pause: 2500,
        hoverPause: true
    });
"); ?>